<?php
namespace Home\Controller;
use Common\Common\Classes\Message;
use Home\Model\TeacherService;
use Think\Controller;

class TeaSettingsController extends HomeController{
    //---------------------------------获得老师的信息---------------------------------
    public function info(){
        $tea_sql = new TeacherService();
        $tea_field= array("tea_id","tea_number","tea_name","tea_email","sex","college_col_id");
        $info = $tea_sql->getInfo($tea_field);
        $this->assign("info",$info);
        $this->display();
    }
    //---------------------------------跳转到修改密码的界面---------------------------------
    public function change_pwd(){
        $this->display();
    }
    //---------------------------------教师修改基本信息的方法---------------------------------
    public function update_tea_info(){
        if(IS_AJAX) {
            $tea_sql = new TeacherService();
            $data = $tea_sql->updateTeacher();
            $this->ajaxReturn($data);
        }
    }
    //---------------------------------修改教师密码的方法---------------------------------
    public function update_tea_pwd(){
        if(IS_AJAX){
            $tea_sql = new TeacherService();
            $data = $tea_sql->updatePWD();
            $this->ajaxReturn($data);
        }
    }
}